<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-sclae=1.0">
    <title>留言区</title>
    <!--  引入title图标  -->
    <link rel="icon" href=../../img/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="../../img/favicon.ico" type="image/x-icon">
    <!-- 引入响应式css-->
    <link rel="stylesheet" href="../../lib/bootstrap3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../lib/bootstrap3.3.7/css/bootstrap-theme.min.css">
    <!--  全局样式  -->
    <link rel="stylesheet" href="../../css/rest.css">
    <link rel="stylesheet" href="../../css/index.css">
    <!-- 全局js-->
    <script src="../../js/index.js"> </script>
    <script src="../../lib/prefixfree.min.js"> </script>
    <script src="../../js/animate.js"></script>
    <script src="../../js/function.js"></script>
    <!--响应式框架js-->
    <script src="../../lib/jquery.ripples.js"></script>
    <script rel="stylesheet" src="../../lib/jquery-3.3.1.min.js"></script>
    <%--    <script src="//cdn.bootcss.com/jquery/2.1.4/jquery.min.js"></script>--%>

    <script src="../../lib/bootstrap3.3.7/js/bootstrap.min.js"> </script>
    <%--    <script src="http://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>--%>
    <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" crossorigin="anonymous"></script>-->

</head>
<body>
<!--    查看留言区-->
<nav>
    <a class="glyphicon glyphicon-chevron-left" href="index.html"> </a>
    <h3>comment</h3>
</nav>
<footer class="liuyanban">
    <form action="" method="post" id="form__">
        <!-- 提交留言区-->
        <textarea name="sentence" id="sentence_" type="text" cols="30" rows="10" placeholder="sentence"></textarea>
        <textarea name="author" id="author_" type="text" cols="5" rows="5" placeholder="write"></textarea>
        <input type="button" id="btn__" style="width: 20px">发布</input>
    </form>
</footer>
<script src="../../js/function.js"> </script>
<script>
    // 发布成功

    $(function () {
        $("#btn__").click(function () {
            $.ajax({
                url:"/sentence/upload",
                type:"POST",
                async: false,
                data:$("#form__").serialize(),
                success:function (result) {
                    if(result.code == 100){
                        window.location.href = "/wyy/index";
                    }else{
                        alert(result.extendInfo.error);
                    }
                },
            })
        });
    })
</script>
</body>
</html>
